#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "glwidget.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    glWidget = new GLWidget();

    ui->glLayout->addWidget(glWidget);

    connect(ui->light1, SIGNAL(clicked()), glWidget, SLOT(flight1()));
    connect(ui->light2, SIGNAL(clicked()), glWidget, SLOT(flight2()));
    connect(ui->light3, SIGNAL(clicked()), glWidget, SLOT(flight3()));
    connect(ui->checkBoxFog, SIGNAL(clicked()), glWidget, SLOT(fog()));
    connect(ui->radioPoly, SIGNAL(clicked()), glWidget, SLOT(renderPolygons()));
    connect(ui->radioWire, SIGNAL(clicked()), glWidget, SLOT(renderWireframe()));
    connect(ui->checkShaders, SIGNAL(clicked()), glWidget, SLOT(shadersOnOff()));
    ui->horizontalSlider->setRange(0,100);
    connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(densityFog(int)));

}

MainWindow::~MainWindow()
{
    delete ui;
}
